import 'package:flutter/material.dart';
import 'package:fluro/fluro.dart';
import 'package:lejiaxueche/config/theme.dart';
import 'package:lejiaxueche/routes/routes.dart';
import 'package:provider/provider.dart';
import './provider/model.dart';
import './pages/start/start.dart';

void main() {
  final router = Router();
  Routes.configureRoutes(router);

  runApp(MultiProvider(
    child: MyApp(),
    providers: [
      ChangeNotifierProvider(create: (et) => ExamTopicModel(et: 0)),
      ChangeNotifierProvider(create: (len) => SubLenModel(
          sub1Len: 0, 
          sub4Len: 100,
          curSubIndex: 1,
          rightNum: 0,
          errorNum: 0
        )
      )
    ],
  )); 
}

class MyApp extends StatefulWidget {

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: StartPage(),
      onGenerateRoute: Routes.router.generator,
      color: Colors.white,
      theme: lightTheme,
    );
  }
}